package com.boge.gateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class GatewayConfig {

//    @Bean
    public RouteLocator customerRouteLocator(RouteLocatorBuilder routeLocatorBuilder){
        // 获取构建多个路由的 routes
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
        routes.route("nacos-provider1",r->r.path("/nacos-provider/**")
                .uri("http://localhost:9100/nacos-provider"));
        return routes.build();

    }
}
